<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/4/2
  Time: 11:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户信息修改</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="plugins/Hplus-v.4.1.0/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="plugins/Hplus-v.4.1.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="plugins/Hplus-v.4.1.0/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="plugins/Hplus-v.4.1.0/css/animate.css" rel="stylesheet">
    <link href="plugins/Hplus-v.4.1.0/css/style.css?v=4.1.0" rel="stylesheet">

    <!-- 全局js -->
    <script src="plugins/Hplus-v.4.1.0/js/jquery.min.js?v=2.1.4"></script>
    <script src="plugins/Hplus-v.4.1.0/js/bootstrap.min.js?v=3.3.6"></script>
</head>
<body>
<div class="ibox-content">
    <form action="UserInfoAddServlet" method="post" class="form-horizontal">
        <input type="hidden" name="userId" id="userId" value="${sessionScope.userInfoBean.userId}">
        <div class="form-group">
            <label class="col-lg-2 control-label">用户名</label>

            <div class="col-lg-8">
                <input type="text" id="userName" name="userName" value="${sessionScope.userInfoBean.userName}" placeholder="请输入用户名" class="form-control"><span id="usertip" style="color: red;display: none">请填写用户名</span>
            </div>
        </div>

        <div class="hr-line-dashed"></div>

        <div class="form-group">
            <label class="col-lg-2 control-label">密码</label>
            <div class="col-lg-8">
                <input type="password"  id="userPwd" name="userPwd" value="${sessionScope.userInfoBean.userPwd}" placeholder="请输入密码"  class="form-control"> <span id="pwdtip" style="color: red;display: none">请填写密码</span>
            </div>
        </div>

        <div class="hr-line-dashed"></div>

        <div class="form-group">
            <label class="col-lg-2 control-label">联系方式</label>

            <div class="col-lg-8">
                <input type="text" id="userTel" name="userTel" value="${sessionScope.userInfoBean.userTel}"  placeholder="请输入联系方式" class="form-control"><span id="teltip" style="color: #ff0000;display: none">请填写联系方式</span>
            </div>
        </div>

        <div class="hr-line-dashed"></div>

        <div class="form-group">
            <label class="col-lg-2 control-label">注册日期</label>

            <div class="col-lg-8">
                <input type="date"  id="userRegisteDate" name="userRegisteDate" value="${sessionScope.userInfoBean.userBirthday}"  class="form-control">
            </div>
        </div>
        <div class="hr-line-dashed"></div>
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-2">
                <button class="btn btn-primary" type="submit" id="sub">确认修改</button>
                <%--                <button class="btn btn-white" type="submit">取消</button>--%>
            </div>
        </div>
    </form>
</div>
<script>
    $("#userName").change(()=>{
        $("#usertip").hide();
    });
    $("#userPwd").change(()=>{
        $("#pwdtip").hide();
    });
    $("#userPwd2").on("change",function (){
        if($("#userPwd").val()!=$("#userPwd2").val()){
            $("#pwd2tip").show();
            return false;
        }else {
            $("#pwd2tip").hide();
        }
    });
    $("#userTel").change(()=>{
        $("#teltip").hide();
    });
    $("#sub").click(()=>{
        if($("#userName").val()==""){
            $("#usertip").show();
            return false;
        }else {
            $("#usertip").hide();
        }
        if($("#userPwd").val()==""){
            $("#pwdtip").show();
            return false;
        }else {
            $("#pwdtip").hide();
        }
        if($("#userTel").val()==""){
            $("#teltip").show();
            return false;
        }else {
            $("#teltip").hide();
        }
    });
</script>
</body>
</html>
